package com.xtr.service;


import com.weibo.api.motan.config.springsupport.annotation.MotanService;
import com.xtr.tx.domain.SysDemo;
import com.xtr.tx.reader.SysDemoReaderMapper;
import com.xtr.tx.service.SysDemoService;
import com.xtr.tx.writer.SysDemoWriterMapper;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>类说明</p>
 *
 * @author 张峰 zfvip_it@163.com
 * @createTime: 2017/11/13 12:59
 */
@MotanService
public class SysDemoServiceImpl implements SysDemoService {

    @Resource
    private SysDemoWriterMapper sysDemoWriterMapper;

    @Resource
    private SysDemoReaderMapper sysDemoReaderMapper;

    @Transactional
    public void save() {
        SysDemo sysDemo = new SysDemo();
        sysDemo.setName("测试1");
        sysDemoWriterMapper.insertSelective(sysDemo);
    }

    public List<SysDemo> readerQueryAll() {
        return sysDemoReaderMapper.selectAll();
    }

    public List<SysDemo> writerQueryAll() {
        return sysDemoWriterMapper.selectAll();
    }

}
